﻿<Window x:Class="Roniz.WCF.Discovery.Extenstions.ServiceTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Roniz.WCF.Discovery.Extenstions.ServiceTest" 
        Title="Service Tester" Height="350" Width="525">

    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Close"
                    Executed="OnClose"
                    CanExecute="OnCanClose"/>
        <CommandBinding Command="local:Commands.OpenServiceCommand"
                        Executed="OpenServiceExecuted"
                        CanExecute="OpenServiceCanExecute" />

        <CommandBinding Command="local:Commands.CloseServiceCommand"
                        Executed="CloseServiceExecuted"
                        CanExecute="CloseServiceCanExecute" />

        <CommandBinding Command="local:Commands.OpenServiceConfigCommand"
                        Executed="OpenServiceConfigExecuted"
                        CanExecute="OpenServiceConfigCanExecute" />

        <CommandBinding Command="local:Commands.CloseServiceConfigCommand"
                        Executed="CloseServiceConfigExecuted"
                        CanExecute="CloseServiceConfigCanExecute" />
    </Window.CommandBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30*" />
            <RowDefinition Height="250*" />
            <RowDefinition Height="30*" />
        </Grid.RowDefinitions>
        <Menu>
            <MenuItem Header="Service">
                <MenuItem Header="Open Service from code" Command="local:Commands.OpenServiceCommand" />
                <MenuItem Header="Close Service from code" Command="local:Commands.CloseServiceCommand"/>
                <Separator />
                <MenuItem Header="Open Service from config" Command="local:Commands.OpenServiceConfigCommand" />
                <MenuItem Header="Close Service from config" Command="local:Commands.CloseServiceConfigCommand"/>
            </MenuItem>
            <MenuItem Header="Discovery options (apply from config only)">
                <MenuItem Header="Use Ad-Hoc (Find)" IsCheckable="True" IsChecked="True" Name="UseAdHocDiscoveryMenuItem" />
                <MenuItem Header="Use Managed (Announcement)" IsCheckable="True" IsChecked="True" Name="UseManagedDiscoveryMenuItem" />
                <MenuItem Header="UDP Discovery" IsCheckable="True" Name="UDPDiscoveryMenuItem" Checked="UdpDiscoveryMenuItemChecked" Unchecked="UdpDiscoveryMenuItemUnchecked" IsChecked="True"/>
                <MenuItem Header="P2P Discovery" IsCheckable="True" Name="P2PDiscoveryMenuItem" Checked="P2PDiscoveryMenuItemChecked" Unchecked="P2PDiscoveryMenuItemUnchecked" />
            </MenuItem>
        </Menu>
    </Grid>
</Window>
